<script setup name="App">
    import { ref,reactive, watch, toRef } from 'vue'
    let geyao=reactive({
        name:'geyao',
        age:18,
    }
    )
    //  let {name,age} = toRefs(geyao)
     var name = toRef(geyao,"name")


    const handleName=()=>{
        name.value=name.value+"-"
    }
    const handleAge=()=>{
        geyao.age=geyao.age+1
    }
 
 
    </script>
    
    <template>
        <!-- <div v-for="item in geyao">{{ item.name }}-{{item.age}}</div> -->
          <div>{{ geyao.name }}</div>
         <div>{{ geyao.age }}</div> 
    
         <button @click="handleAge">修改年龄</button>
         <button @click="handleName">修改姓名</button>
    
    </template>
    
    <style scoped>
    
    </style>
    
    
    
    
    